public class Sudoku {

    public boolean isVildSudoku(char[][] array){
        int[][] cloums= new int[9][9];
        int[][] rows=new int[9][9];
        int[][][] three=new int[3][3][9];
        for (int i = 0; i <array.length ; i++) {
            for (int j = 0; j <array[i].length ; j++) {
                char a=array[i][j];
                if(a!='.'){
                    int index=a-'0'-1;
                    cloums[i][index]++;
                    rows[j][index]++;
                    three[i/3][j/3][index]++;
                    if(cloums[i][index]++>1||rows[j][index]++>1||three[i/3][j/3][index]++>1){
                        return false;
                    }
                }
            }
        }
        return true;
    }
}
